﻿@using System.Collections
@using System.Runtime.InteropServices
@using Model

@model Model.Toolbar
@{

    string gridName = Model.GridName ?? "dg";
    string gridType = Model.GridType ?? "datagrid";
    string toolBar = Model.ToolbarName ?? "toolbar";
    string prefix = Model.Prefix ?? "";
    IDictionary<string, List<FunctionModule>> functionModule = Model.FunctionModule;
    
}
<div id="@toolBar" class="datagrid-toolbar">
    <table cellspacing="0" cellpadding="0">
        <tbody>
            <tr>

                @if (functionModule != null && functionModule["Function"] != null)
                {
                    foreach (var item in functionModule["Function"])
                    {

                        if (item.Name == "Add" && item.IsEnable)
                        {
                    <td>
                        <a class="l-btn l-btn-plain" href="javascript:void(0)"><span class="l-btn-left"><span class="l-btn-text icon-add l-btn-icon-left" style="padding-left: 20px;">添加</span></span></a>
                    </td>
                    <td>
                        <div class="datagrid-btn-separator"></div>
                    </td>
                        }
                        if (item.Name == "Edit" && item.IsEnable)
                        {
                    <td>
                        <a class="l-btn l-btn-plain" href="javascript:void(0)"><span class="l-btn-left"><span class="l-btn-text icon-edit l-btn-icon-left" style="padding-left: 20px;">修改</span></span></a>
                    </td>
                    <td>
                        <div class="datagrid-btn-separator"></div>
                    </td>
                        }
                        if (item.Name == "Remove" && item.IsEnable)
                        {
                    <td>
                        <a class="l-btn l-btn-plain" href="javascript:void(0)"><span class="l-btn-left"><span class="l-btn-text icon-remove l-btn-icon-left" style="padding-left: 20px;">删除</span></span></a>
                    </td>
                    <td>
                        <div class="datagrid-btn-separator"></div>
                    </td>
                        }

                        if (item.Name == "Reload" && item.IsEnable)
                        {
                    <td>
                        <a class="l-btn l-btn-plain" href="javascript:void(0)"><span class="l-btn-left"><span class="l-btn-text icon-reload l-btn-icon-left" style="padding-left: 20px;">刷新</span></span></a>
                    </td>
                    <td>
                        <div class="datagrid-btn-separator"></div>
                    </td>
                        }
                        if (item.Name == "Collapse" && item.IsEnable)
                        {
                    <td>
                        <a id="btnOnOff" href="javascript:void(0);" class="easyui-linkbutton" title="展开" data-options="iconCls:'icon-collapse',plain:true" style="padding-left: 20px;">展开/折叠</a>
                    </td>
                    <td>
                        <div class="datagrid-btn-separator"></div>
                    </td>
                        }
                        if (item.Name == "Exporter" && item.IsEnable)
                        {
                    <td>
                        <a class="l-btn l-btn-plain" href="javascript:void(0)"><span class="l-btn-left"><span class="l-btn-text icon-exporter l-btn-icon-left" style="padding-left: 20px;">导出</span></span></a>
                    </td>
                    <td>
                        <div class="datagrid-btn-separator"></div>
                    </td>
                        }
                        if (item.Name == "IsStatus" && item.IsEnable)
                        {
                    <td>
                        <a class="l-btn l-btn-plain" href="javascript:void(0)"><span class="l-btn-left"><span class="l-btn-text icon-status l-btn-icon-left" style="padding-left: 20px;">启用</span></span></a>
                    </td>
                    <td>
                        <div class="datagrid-btn-separator"></div>
                    </td>
                        }
                        if (item.Name == "AllEdit" && item.IsEnable)
                        {
                    <td>
                        <a class="l-btn l-btn-plain" href="javascript:void(0)"><span class="l-btn-left"><span class="l-btn-text icon-alledit l-btn-icon-left" style="padding-left: 20px;">批量修改</span></span></a>
                    </td>
                    <td>
                        <div class="datagrid-btn-separator"></div>
                    </td>
                        }
                        if (item.Name == "BatchRemove" && item.IsEnable)
                        {
                    <td>
                        <a class="l-btn l-btn-plain" href="javascript:void(0)"><span class="l-btn-left"><span class="l-btn-text icon-batchRemove l-btn-icon-left" style="padding-left: 20px;">批次号删除</span></span></a>
                    </td>
                    <td>
                        <div class="datagrid-btn-separator"></div>
                    </td>
                        }
                    }
                }
            </tr>
        </tbody>
    </table>
</div>

